local ygzw = fk.CreateSkill({
  name = "df__yueguizhiwu",
    tags = {Skill.Compulsory}, 
})

ygzw:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(ygzw.name) then
      for _, move in ipairs(data) do
        if move.skillName ~= ygzw.name and move.toArea == Card.DiscardPile and move.moveReason ~= fk.ReasonUse and move.from == player then
          for _, info in ipairs(move.moveInfo) do
            local card = Fk:getCardById(info.cardId)
            if (card.trueName == "slash") and
              table.contains(player.room.discard_pile, info.cardId) then
              return true
            end
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local ids = {}
    for _, move in ipairs(data) do
      if move.toArea == Card.DiscardPile and move.moveReason ~= fk.ReasonUse then
        for _, info in ipairs(move.moveInfo) do
          local card = Fk:getCardById(info.cardId)
          if card.trueName == "slash" and
            table.contains(room.discard_pile, info.cardId) then
            table.insert(ids, info.cardId)
          end
        end
      end
    end
    player:addToPile(ygzw.name, ids, true, ygzw.name, player)
  end,
})

ygzw:addEffect("active", {
  anim_type = "control",
  prompt = "移去任意张武将牌旁的牌",
  card_num = 0,
  target_num = 0,
  can_use = function(self, player)
    return #player:getPile(ygzw.name) > 0 and player:getMark("df__yueguizhiwu-turn") == 0
  end,
  target_filter = Util.FalseFunc,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    player.room:setPlayerMark(player, "df__yueguizhiwu-turn",1)
    local cards = room:askToCards(player, {
      min_num = 1,
      max_num = #player:getPile(ygzw.name)/2,
      include_equip = false,
      pattern = "",
      prompt = "移去任意张武将牌旁的牌",
      skill_name = ygzw.name,
      expand_pile = ygzw.name,
    })
    local n = #cards
    room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, ygzw.name, nil, true, player)
    local cnt = 0
    for _, id in ipairs(player:getPile(ygzw.name)) do
      if player.dead or cnt == n then break end
      room:askToUseRealCard(player, {
        pattern = { id },
        skill_name = ygzw.name,
        extra_data = {
        bypass_times = true,
        expand_pile = { id },
        extraUse = true,
        },
      })
      cnt = cnt + 1
    end
  end,
})

Fk:loadTranslationTable {
["df__yueguizhiwu"] = "月桂之舞",
[":df__yueguizhiwu"] = "<b>锁定技</b>，当你的牌非因使用或打出而置入弃牌堆后，你将其中的【杀】置于武将牌旁；出牌阶段限一次，你可以移去因此放置的任意张牌，然后依次使用等量张剩余的牌。",
["#df__yueguizhiwu"] = "",
["$df__yueguizhiwu1"] = "",
["$df__yueguizhiwu2"] = "",
}
return ygzw  